<template>
  <div class="login-accout">
    <el-form :model="accout" label-position="right" ref="formRef">
      <el-form-item label="账户名" prop="accout">
        <el-input v-model="accout.name" placeholder="请输入账号名" />
      </el-form-item>
      <el-form-item label="密码">
        <el-input v-model="accout.password" placeholder="请输入密码" />
      </el-form-item>
    </el-form>
  </div>
</template>

<script>
import { reactive, ref } from "vue";
import useLoginStote from "@/store/login";
export default {
  setup() {
    const store = useLoginStote();

    const accout = reactive({
      name: "coderwhy",
      password: "123456",
    });

    const formRef = ref();

    const loginAction = () => {
      store.accoutLoginAction({ ...accout });
    };

    return {
      accout,
      loginAction,
      formRef,
    };
  },
};
</script>

<style lang="less" scoped></style>
